import React, { Component } from 'react';
import './zxsl.scss';

class Com extends Component {
    constructor (props) {
      super(props)
      this.state = {
        zxsltimuist:[]
      }
    }

    componentDidMount () {
        fetch('http://poem.daxunxun.com:8000/api/juzi')
        .then(res => res.json())
        .then(data => {
          this.setState({
            zxsltimuist:data
          })
        })
    }
  
    render () {
      return (
          <div className = "zxsltimu">
            <div className = "zxslto"></div>
            <div className = "zxslcon">
                <h2>最新收录</h2>
                <ul>
                    {
                        this.state.zxsltimuist.map((item,index)=>{
                            return(
                                <li key={index}>
                                    <i>{item.title}</i>
                                    <span>{item.name}</span>
                                </li>
                            )
                        })
                    }
                </ul>
            </div>
            <div className = "zxslbon"></div>
          </div>
      )
    }
  }
  
  export default Com;